-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Add new Approach docs page #25165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Approach docs page #25165
Conversation
Pushed an extensive update here after the first outline. Would love feedback from @twbs/team on what else we should put here. |
I think it's a pretty good first approach 👍 |
docs/4.0/extend/approach.md
Outdated
|
||
## Base and modifier classes | ||
|
||
- Components should be built with a base class that houses common, not-to-be overridden property-value pairs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a comment about when to create a modifier class and when to just create a new component? I'd say that if we need to modify the color (like primary, warning, etc) or the scale (like lg or sm) of the component then we generate a modifier, if it's anything else then it's a new component.
Specifically regarding custom CSS, utilities can help combat increasing file size by reducing your most commonly repeated property-value pairs into single classes. This can have a dramatic effect at scale in your projects. | ||
|
||
## Flexible HTML | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also mention that we never do type selectors, and elements are styled through classes.
@mdo: is this ready to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future, perhaps something generic about Bootstrap trying to be a generic foundation, rather than trying to solve every possible use case. That authors need to still make sure they use good semantic markup. And cross-reference to the accessibility page? But as a starting point, this is great.
@mdo: anyway, I'll leave this for you to merge, just please make sure you squash when merging. |
Was reviewing last night and fell asleep without hitting submit. 😆 This should be good to go now. I'm reviewing some issues and PRs and going to get some things merged today. |
Super WIP, but the page exists with no outline at all. Adding one here to at least capture a few things.